import { DocLayoutIndex } from "@/routers/constants";
import { RouteObject } from "../../types/router";
import React from "react";
import lazyLoad from "@/routers/components/LazyLoad";
import { Navigate } from "react-router-dom";
// 首页模块
const SettingRouter: Array<RouteObject> = [
	{
		element: <DocLayoutIndex />,
		children: [
			{
				path: "/app/doc",
				meta: {
					requiresAuth: false,
					title: "文档库",
					key: "doc"
				},
				children: [
					{
						// 默认重定向到第一个子路由
						path: "/app/doc",
						element: <Navigate to="/app/doc/home" replace={true} />,
						meta: {
							requiresAuth: false,
							title: "文档库首页",
							isPageLayout: true,
							key: "doc-redirect"
						}
					},
					{
						// 默认重定向到第一个子路由
						path: "/app/doc/home",
						element: lazyLoad(React.lazy(() => import("@/pages/app/doc"))),
						meta: {
							requiresAuth: false,
							title: "文档库首页",
							isPageLayout: false,
							key: "doc-home"
						}
					}
					// {
					// 	// 默认重定向到第一个子路由
					// 	path: "/app/doc/edit",
					// 	element: lazyLoad(React.lazy(() => import("@/pages/app/doc/editor"))),
					// 	meta: {
					// 		requiresAuth: false,
					// 		title: "文档编写",
					// 		isPageLayout: false,
					// 		key: "doc-editor"
					// 	}
					// }
				]
			}
		]
	}
];

export default SettingRouter;
